package tto.gio.next;


import android.app.Activity;
import android.app.SearchManager;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;



public class SearchGrabber extends Activity {
	@Override
	protected void onCreate(Bundle savedInstanceState) {
	
		super.onCreate(savedInstanceState);
		handleIntent(getIntent());
	}
	@Override
	protected void onNewIntent(Intent intent) {
	        // Because this activity has set launchMode="singleTop", the system calls this method
	        // to deliver the intent if this activity is currently the foreground activity when
	        // invoked again (when the user executes a search from this activity, we don't create
	        // a new instance of this activity, so the system delivers the search intent here)
	        handleIntent(intent);
	}
	private void handleIntent(Intent intent)
	{
		String query = "";
		if(Intent.ACTION_SEARCH.equals(intent.getAction()))
		{
			query = intent.getStringExtra(SearchManager.QUERY);
			
		}
		Log.d(tag,query);
	}
	String tag = "tto.gio.next";
}

